﻿@model IEnumerable<CardInChina.Bussiness.Frontend.Models.Game>
@{
    int gameCount = 0;
    int i = 0;
    int j = 0;
    if (Model != null)
    {
        gameCount = Model.Count();
    }
}  

<div class="search_game_area_img">
    @for (; i < gameCount; i++)
    {
         <ul>
        @for (j = 0;  j < 5 && i < gameCount; j++,i++)
        {
            string photo;
            photo = Model.ElementAt(i).GamePhoto;
            <li>
                @if (!string.IsNullOrEmpty(photo))
                {
                    <a href="@Url.Action("Index", "Game", new { gameKey = Model.ElementAt(i).GameKey }, null)">
                        <img src="/content/images/photo/@photo" /></a>
                }
                else
                {
                    <a href="@Url.Action("Index", "Game", new { gameKey = Model.ElementAt(i).GameKey }, null)">
                        <img src="/content/images/ss.gif" /></a>
                }
                <br />
                @Html.ActionLink(Model.ElementAt(i).GameName, "Index", "Game", new { gameKey = Model.ElementAt(i).GameKey }, null)
            </li>
        }
    </ul>
    }
    
</div>
